package com.luocj.muke.demo.activity;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.luocj.muke.demo.R;

public class PushNoticeActivity extends Activity implements OnClickListener {
    private Activity act;
    private TextView sure, tv_no;
    private String order_sn, order_type, confirm_time, title, url, img_url;
    private RelativeLayout rl_push_pingjia;
    private ImageView iv_pingjia;

    // intent2.putExtra("title",json.getString("title"));//推过来的图片对应的字体
    // intent2.putExtra("url",json.getString("url"));//推过来的图片
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.push_notice);
        initview();
    }

    @Override
    public void onBackPressed() {
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    private void initview() {
//        order_sn = getIntent().getStringExtra("order_sn");
//        order_type = getIntent().getStringExtra("order_type");
//        confirm_time = getIntent().getStringExtra("confirm_time");
//        title = getIntent().getStringExtra("title");
//        url = getIntent().getStringExtra("url");
//        img_url = getIntent().getStringExtra("img_url");
//        act = this;
//        act.setFinishOnTouchOutside(false);
//        sure = (TextView) findViewById(R.id.sure);
//        sure.setOnClickListener(this);
//        tv_no = (TextView) findViewById(R.id.tv_no);
//        tv_no.setOnClickListener(this);
//        rl_push_pingjia = (RelativeLayout) findViewById(R.id.rl_push_pingjia);
//        rl_push_pingjia.getBackground().setAlpha(100);// 0~255透明度值
//        iv_pingjia = (ImageView) findViewById(R.id.iv_pingjia);
//        iv_pingjia.setOnClickListener(this);
//        MyLog.e("url===========================" + url);
//        //显示头像
//        BaseImageUtils.setImage(img_url, iv_pingjia, 0);

        Window win = PushNoticeActivity.this.getWindow();
        win.getDecorView().setPadding(0, 0, 0, 0);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.sure:
//                if (SqliteUtils.getuserindex().equals("")) {// 用户索引为空
//                    Intent intent43 = new Intent(act, Login_Act_New.class);
//                    startActivity(intent43);
//                } else {// 订单已完成 前往评价
//                    Intent backIntent = new Intent(act, EvaluateAct.class);
//                    backIntent.putExtra("order_sn", order_sn);
//                    backIntent.putExtra("order_type", order_type);
//                    backIntent.putExtra("confirm_time", confirm_time);
//                    backIntent.putExtra("isbackground", "1");
//                    startActivity(backIntent);
//                    act.finish();
//                }
                break;
            case R.id.tv_no:
//                act.finish();
                break;
            case R.id.iv_pingjia:
//			Intent intent9 = new Intent(this, WebViewAct.class);
//			intent9.putExtra("type", "27");
//			intent9.putExtra("url", url);
//			intent9.putExtra("title", title);
//			startActivity(intent9);
                break;

            default:
                break;
        }
    }

    @Override
    public Resources getResources() {
        Resources res = super.getResources();
        Configuration config = new Configuration();
        config.setToDefaults();
        res.updateConfiguration(config, res.getDisplayMetrics());
        return res;
    }

    @Override
    protected void onDestroy() {
//        ExitUtil.getInstant().removePool(this);
        super.onDestroy();
    }

}
